package main

type ErrorResponse struct {
	Success      bool   `json:"success" required:"true" example:"false"`
	ErrorMessage string `json:"errorMessage" required:"true" example:"错误提示消息"`
}

type DeployRequest struct {
	Owner   string `json:"owner" required:"true" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	Name    string `json:"name" required:"true" example:"作品名称"`
	BaseURI string `json:"baseURI" required:"true" example:"/api/product"`
}

type DeployBatchRequest struct {
	Items []DeployRequest `json:"items" required:"true"`
}

// DeployResponse 合约部署接口响应
type DeployResponse struct {
	Success bool `json:"success" required:"true" example:"true"`
	Data    struct {
		Address     string `json:"address" required:"true" example:"0x392c076e1f2284d4434d1d283786d48e2b96f6e5"`
		Transaction `json:"transaction" required:"true"`
	} `json:"data,omitempty"`
}

// DeployBatchResponse 批量合约部署接口响应
type DeployBatchResponse struct {
	Success bool `json:"success" required:"true" example:"true"`
	Data    []struct {
		Address     string `json:"address" required:"true" example:"0x392c076e1f2284d4434d1d283786d48e2b96f6e5"`
		Transaction `json:"transaction" required:"true"`
	} `json:"data,omitempty"`
}

type MintRequest struct {
	Contract string `json:"contract" required:"true" example:"0x392c076e1f2284d4434d1d283786d48e2b96f6e5"`
	Owner    string `json:"owner" required:"true" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	TokenURI string `json:"tokenURI" required:"true" example:"/test1"`
}

type MintResponse struct {
	Success bool `json:"success" required:"true" example:"true"`
	Data    struct {
		TokenID     string      `json:"tokenID" required:"true" example:"1"`
		Transaction Transaction `json:"transaction" required:"true"`
	} `json:"data,omitempty"`
}

type MintBatchRequest struct {
	Contract string `json:"contract" required:"true" example:"0x392c076e1f2284d4434d1d283786d48e2b96f6e5"`
	Items    []struct {
		Owner    string `json:"owner" required:"true" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
		TokenURI string `json:"tokenURI" required:"true" example:"/test1"`
	} `json:"items"`
}

type MintBatchResponse struct {
	Success bool `json:"success" required:"true" example:"true"`
	Data    []struct {
		TokenID     string      `json:"tokenID" required:"true" example:"1"`
		Transaction Transaction `json:"transaction" required:"true"`
	} `json:"data,omitempty"`
}

type Transaction struct {
	TxHash      string `json:"txHash" required:"true"  example:"0x49fa645a8014f1b9f59b987a1f58c1362d6d63b817ea63509883d4bc78de0840"`
	Status      uint64 `json:"status,omitempty" example:"1"`
	BlockNumber uint64 `json:"blockNumber,omitempty" example:"1"`
	BlockTime   uint64 `json:"blockTime,omitempty" example:"1671706800"`
	Gas         uint64 `json:"gas,omitempty" example:"500000"`
}
